var MyCircularQueue = function(k) {
    this.list = new Array(k)
    this.front  = 0,
    this.rear  = 0
    this.size = 0

};
MyCircularQueue.prototype.enQueue = function(value) {
    if (this.size == this.list.length){
        return false
    }
    this.list[this.rear] = value
    this.size++
    this.rear = this.rear == this.list.length-1? 0 : this.rear+1

    return true
};
MyCircularQueue.prototype.deQueue = function() {
    if (this.isEmpty()){
        return false
    }
	let item = this.list[this.front]
    this.list[this.front] = ''
    this.size--
    this.front = this.front == this.list.length-1? 0: this.front+1
    return item

};
MyCircularQueue.prototype.Front = function() {
    if (this.isEmpty()){
        return -1
    }
    return this.list[this.front]

};
MyCircularQueue.prototype.Rear = function() {
    if (this.isEmpty()){
        return -1
    }
    return this.rear == 0 ? this.list[this.list.length - 1] : this.list[this.rear - 1];

};
MyCircularQueue.prototype.isEmpty = function() {
    return this.size == 0

};
MyCircularQueue.prototype.isFull = function() {
    return this.size == this.list.length
};
export  default  MyCircularQueue